@Component
public class JWTChannelInterceptor implements ChannelInterceptor {
    @Override
    public Message<?> preSend(Message<?> message,
                              MessageChannel channel) {
        // get accessor from message header
        if (/* accessor is valid */) {
            // extract header
            if (/* header is not empty */()) {
                // extrack token
                if (/* token is valid */) {
                    // extract username from token
                    // and set it into accossor
                    return message;
                }
            }
        }
        return null;
    }
}
